package view;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.SystemColor;

import javax.swing.DefaultComboBoxModel;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JScrollPane;
import javax.swing.JSplitPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.ScrollPaneConstants;
import javax.swing.UIManager;
import javax.swing.border.TitledBorder;
import javax.swing.table.DefaultTableModel;

import com.jgoodies.forms.factories.FormFactory;
import com.jgoodies.forms.layout.ColumnSpec;
import com.jgoodies.forms.layout.FormLayout;
import com.jgoodies.forms.layout.RowSpec;
import java.awt.FlowLayout;

public class PanelThongKe extends JPanel {
	private static final long serialVersionUID = 7058042569974012127L;
	private JTextField textField;
	private JTextField textField_1;
	private JTable table;
	private JTextField textField_4;
	private JTextField textField_5;
	private JTextField textField_6;
	private JTextField textField_7;
	private JTextField textField_2;
	private JTextField textField_3;

	/**
	 * Create the panel.
	 */
	public PanelThongKe() {
		setLayout(new BorderLayout(0, 0));
		
				JPanel panel_2 = new JPanel();
				panel_2.setBorder(new TitledBorder(UIManager
						.getBorder("TitledBorder.border"), "Th\u00F4ng tin",
						TitledBorder.LEADING, TitledBorder.TOP, null, new Color(51,
								153, 255)));
				add(panel_2, BorderLayout.NORTH);
				panel_2.setLayout(new FormLayout(new ColumnSpec[] {
						FormFactory.DEFAULT_COLSPEC,
						FormFactory.RELATED_GAP_COLSPEC,
						ColumnSpec.decode("default:grow"),},
					new RowSpec[] {
						FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.DEFAULT_ROWSPEC,
						FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.DEFAULT_ROWSPEC,
						FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.DEFAULT_ROWSPEC,}));
				
						JLabel lblNgyLp = new JLabel("Ngày lập");
						panel_2.add(lblNgyLp, "1, 2");
						
								textField = new JTextField();
								panel_2.add(textField, "3, 2");
								textField.setColumns(10);
								
										JLabel lblNhnVinLp = new JLabel("Nhân viên lập");
										panel_2.add(lblNhnVinLp, "1, 4");
										
												textField_1 = new JTextField();
												panel_2.add(textField_1, "3, 4");
												textField_1.setColumns(10);
												
														JLabel lblThiGian = new JLabel("Thời gian");
														panel_2.add(lblThiGian, "1, 6");
														
																textField_4 = new JTextField();
																panel_2.add(textField_4, "3, 6");
																textField_4.setColumns(10);

		JSplitPane splitPane = new JSplitPane();
		splitPane.setOneTouchExpandable(true);
		splitPane.setOrientation(JSplitPane.VERTICAL_SPLIT);
		add(splitPane, BorderLayout.CENTER);

		JPanel panel = new JPanel();
		panel.setBorder(new TitledBorder(UIManager
				.getBorder("TitledBorder.border"),
				"Danh s\u00E1ch th\u1ED1ng k\u00EA", TitledBorder.LEADING,
				TitledBorder.TOP, null, new Color(51, 153, 255)));
		splitPane.setRightComponent(panel);
		panel.setLayout(new BorderLayout(0, 0));

		JScrollPane scrollPane = new JScrollPane();
		scrollPane
				.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
		scrollPane
				.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
		panel.add(scrollPane);

		table = new JTable();
		table.setModel(new DefaultTableModel(new Object[][] {
				{ null, null, null, null, null, null, null },
				{ null, null, null, null, null, null, null },
				{ null, null, null, null, null, null, null },
				{ null, null, null, null, null, null, null },
				{ null, null, null, null, null, null, null },
				{ null, null, null, null, null, null, null },
				{ null, null, null, null, null, null, null },
				{ null, null, null, null, null, null, null },
				{ null, null, null, null, null, null, null }, }, new String[] {
				"STT", "M\u00E3 h\u00F3a \u0111\u01A1n", "S\u1EC9/l\u1EBB",
				"Ng\u00E0y l\u1EADp", "Nh\u00E2n vi\u00EAn",
				"Kh\u00E1ch h\u00E0ng", "Doanh thu" }));
		table.getColumnModel().getColumn(0).setPreferredWidth(15);
		table.getColumnModel().getColumn(0).setMinWidth(5);
		scrollPane.setViewportView(table);

		JPanel panel_6 = new JPanel();
		panel.add(panel_6, BorderLayout.SOUTH);
		panel_6.setLayout(new BorderLayout(0, 0));

		JLabel lblTngHan = new JLabel("Tổng hóa đơn:");
		lblTngHan.setIcon(new ImageIcon(PanelThongKe.class.getResource("/images/hoadon.png")));
		panel_6.add(lblTngHan, BorderLayout.NORTH);

		JLabel lblTngDoanhThu = new JLabel("Tổng doanh thu:");
		lblTngDoanhThu.setIcon(new ImageIcon(PanelThongKe.class.getResource("/images/dollar.png")));
		panel_6.add(lblTngDoanhThu, BorderLayout.SOUTH);

		JPanel panel_1 = new JPanel();
		splitPane.setLeftComponent(panel_1);
		panel_1.setLayout(new BorderLayout(0, 0));

		JSplitPane splitPane_1 = new JSplitPane();
		splitPane_1.setOneTouchExpandable(true);
		panel_1.add(splitPane_1);

		JPanel panel_3 = new JPanel();
		panel_3.setBorder(new TitledBorder(UIManager
				.getBorder("TitledBorder.border"),
				"Ki\u1EC3u th\u1ED1ng k\u00EA", TitledBorder.LEADING,
				TitledBorder.TOP, null, new Color(51, 153, 255)));
		splitPane_1.setRightComponent(panel_3);
		panel_3.setLayout(new FormLayout(new ColumnSpec[] {
				FormFactory.RELATED_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC,
				FormFactory.RELATED_GAP_COLSPEC,
				ColumnSpec.decode("max(152dlu;default):grow"), },
				new RowSpec[] { FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.DEFAULT_ROWSPEC,
						FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.DEFAULT_ROWSPEC,
						FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.DEFAULT_ROWSPEC,
						FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.DEFAULT_ROWSPEC,
						FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.DEFAULT_ROWSPEC,
						FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.DEFAULT_ROWSPEC,
						FormFactory.RELATED_GAP_ROWSPEC,
						RowSpec.decode("default:grow"), }));

		JCheckBox chckbxMSnPhm = new JCheckBox("Mã sản phẩm");
		panel_3.add(chckbxMSnPhm, "2, 2");

		textField_5 = new JTextField();
		panel_3.add(textField_5, "4, 2, fill, default");
		textField_5.setColumns(10);

		JCheckBox chckbxNhSnXut = new JCheckBox("Nhà sản xuất");
		panel_3.add(chckbxNhSnXut, "2, 4");

		textField_6 = new JTextField();
		panel_3.add(textField_6, "4, 4, fill, default");
		textField_6.setColumns(10);

		JCheckBox chckbxLoiSnPhm = new JCheckBox("Loại sản phẩm");
		panel_3.add(chckbxLoiSnPhm, "2, 6");

		textField_7 = new JTextField();
		panel_3.add(textField_7, "4, 6, fill, default");
		textField_7.setColumns(10);

		JRadioButton rdbtnKhchHng = new JRadioButton("Khách hàng");
		panel_3.add(rdbtnKhchHng, "2, 8");

		JComboBox<String> comboBox_3 = new JComboBox<String>();
		comboBox_3.setModel(new DefaultComboBoxModel<String>(new String[] {
				"Sỉ ", "Lẻ" }));
		panel_3.add(comboBox_3, "4, 8, fill, default");

		JRadioButton rdbtnHoadn = new JRadioButton("Hóa đơn");
		panel_3.add(rdbtnHoadn, "2, 10");

		JComboBox<String> comboBox_2 = new JComboBox<String>();
		comboBox_2.setModel(new DefaultComboBoxModel<String>(new String[] {
				"Hóa đơn bán", "Hóa đơn mua" }));
		panel_3.add(comboBox_2, "4, 10, fill, default");

		JRadioButton rdbtnHngTnKho = new JRadioButton("Hàng tồn kho");
		panel_3.add(rdbtnHngTnKho, "2, 12");

		JPanel panel_7 = new JPanel();
		panel_3.add(panel_7, "2, 14, 3, 1, fill, fill");
		panel_7.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));

		JButton button = new JButton("");
		panel_7.add(button);
		button.setIcon(new ImageIcon(PanelThongKe.class.getResource("/images/dollar.png")));

		JButton button_1 = new JButton("");
		panel_7.add(button_1);
		button_1.setIcon(new ImageIcon(PanelThongKe.class.getResource("/images/chartIcon.png")));

		JPanel panel_5 = new JPanel();
		panel_5.setBorder(new TitledBorder(null,
				"Lo\u1EA1i th\u1ED1ng k\u00EA", TitledBorder.LEADING,
				TitledBorder.TOP, null, SystemColor.textHighlight));
		splitPane_1.setLeftComponent(panel_5);
		panel_5.setLayout(new FormLayout(new ColumnSpec[] {
				FormFactory.RELATED_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC,
				FormFactory.RELATED_GAP_COLSPEC,
				ColumnSpec.decode("default:grow"), }, new RowSpec[] {
				FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, }));

		JRadioButton rdbtnNgy = new JRadioButton("Ngày");
		panel_5.add(rdbtnNgy, "2, 2");

		textField_2 = new JTextField();
		panel_5.add(textField_2, "4, 2, fill, default");
		textField_2.setColumns(10);

		JRadioButton rdbtnNm = new JRadioButton("Năm");
		panel_5.add(rdbtnNm, "2, 6");

		textField_3 = new JTextField();
		panel_5.add(textField_3, "4, 6, fill, default");
		textField_3.setColumns(10);

		JRadioButton rdbtnThng = new JRadioButton("Tháng");
		panel_5.add(rdbtnThng, "2, 10");

		JComboBox<String> comboBox = new JComboBox<String>();
		comboBox.setModel(new DefaultComboBoxModel<String>(new String[] { "01",
				"02", "03", "04", "05", "06", "07", "08", "09", "10", "11",
				"12" }));
		panel_5.add(comboBox, "4, 10, fill, default");

		JRadioButton rdbtnQu = new JRadioButton("Quý");
		panel_5.add(rdbtnQu, "2, 14");

		JComboBox<String> comboBox_1 = new JComboBox<String>();
		comboBox_1.setModel(new DefaultComboBoxModel<String>(new String[] {
				"1", "2", "3", "4" }));
		panel_5.add(comboBox_1, "4, 14, fill, default");

	}

}
